<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>密码修改</title>
    <link rel="stylesheet" href="../../addons/party_member/public/css/weui.min.css">
    <link rel="stylesheet" href="../../addons/party_member/public/css/jquery-weui.min.css">

    <!-- body 最后 -->
    <script src="../../addons/party_member/public/js/jquery.min.js"></script>
    <script src="../../addons/party_member/public/js/jquery-weui.min.js"></script>

    <!-- 如果使用了某些拓展插件还需要额外的JS -->
    <script src="../../addons/party_member/public/js/swiper.min.js"></script>
    <script src="../../addons/party_member/public/js/city-picker.min.js"></script>
    <script src="../../addons/party_member/public/js/function.js"></script>
    <style>
        body{
            margin: 0px;
            padding: 0px;

        }
        .box{
            position: absolute;
            width: 100%;
            height: 100%;
            margin: 0px;
            padding: 0px;
            background: url("../addons/party_member/public/image/login/loginbg.png") no-repeat;

        }
        .head_return{
            display: inline-block;
            position: absolute;
            left: 10px;
            top: 10px;
            width: 20px;
            height: 23px;
            background: url("../addons/party_member/public/image/evaluation/return.png") no-repeat;
            background-size: 12px 23px;

        }
        .btn{
            text-align: center;
            margin-top: 30px
        }
        .btn input{
            width: 40%;
            height: 50px;
            font-size: 20px;
            font-weight: bold;
            margin: 0 4%;
        }

        .footer{
            position: absolute;
            bottom: 0px;
            height: 50px;
            width: 100%;
            line-height: 50px;
            text-align: center;
            color: #ffffff;
        }
        .footer div{
            margin: auto;
            width: 92%;
            height: 1px;
            background-color: #ffffff;
            display: block;
        }
        .weui-cell:before{

            border:none;
        }
        .weui-cell:after{
            content: " ";
            position: absolute;
            bottom: 0;
            right: 15px;
            height: 1px;
            border-top: 2px solid #ffffff;
            color: #d9d9d9;
            -webkit-transform-origin: 0 0;
            transform-origin: 0 0;
            -webkit-transform: scaleY(.5);
            transform: scaleY(.5);
            left: 15px;
        }
        .weui-cells:after{
             border: none;
         }
        .weui-cells:before{
            border: none;
        }
        @media screen and (max-height: 400px) {
            .footer {
                display: none;
            }
        }

    </style>
</head>
<body>
<div class="box">
    <div class="weui-cells__title" style="font-weight: bold;color:#000000;margin-top:0px;background-color: #ffffff;height: 43px;text-align: center;font-size: 18px;line-height: 43px;">
        <span class="head_return"></span>
        密码修改
    </div>
    <div class="weui-cells weui-cells_form" style="margin-top: 0px;background: none;color: #ffffff;">
        <div class="weui-cell"  style="height: 35px">
            <div class="weui-cell__hd"><label class="weui-label" >手机号码</label></div>
            <div class="weui-cell__bd">
                <input class="weui-input" id="phone"  type="number" pattern="[0-9]*" placeholder="请输入手机号">
            </div>
        </div>
        <div class="weui-cell"  style="height: 35px">
            <div class="weui-cell__hd"><label class="weui-label" >旧密码</label></div>
            <div class="weui-cell__bd">
                <input id="pwd" class="weui-input"  type="password"  placeholder="请输入旧密码">
            </div>
        </div>
        <div class="weui-cell"  style="height: 35px;">
            <div class="weui-cell__hd"><label class="weui-label">新密码</label></div>
            <div class="weui-cell__bd">
                <input id="newpwd" class="weui-input" type="password"  placeholder="请输入新密码">
            </div>
        </div>
        <div class="weui-cell"  style="height: 35px;">
            <div class="weui-cell__hd"><label class="weui-label">确认新密码</label></div>
            <div class="weui-cell__bd">
                <input id="renewpwd" class="weui-input" type="password"  placeholder="请再次输入新密码">
            </div>
        </div>

    </div>
    <div class="btn">
        <input class="weui-btn weui-btn_mini weui-btn_warn" id="submit" type="submit" value="确认"/>
        <input onclick="window.history.back()" class="weui-btn weui-btn_mini weui-btn_warn" type="submit" value="取消"/>
    </div>
    <div class="footer">
        <div></div>
        <p>忘记密码请联系支部管理员</p>
    </div>
</div>
<script>
    $(function () {
        $('#submit').click(function () {
            var phone = $("#phone").val()
            var pwd = $("#pwd").val()
            var newpwd = $("#newpwd").val()
            var renewpwd = $("#renewpwd").val()
            if (phone==""){
                $.alert("请输入手机号码");
                return
            }
            if (pwd==""){
                $.alert("请输入原密码");
                return
            }
            if (newpwd==""){
                $.alert("请输入新密码");
                return
            }
            if (renewpwd==""){
                $.alert("请重复输入新密码");
                return
            }
            if(newpwd!=renewpwd){
                $.alert("重复新密码错误");
                return
            }


            $.showLoading();
            $.post('{php echo $this->createMobileUrl("repwdAjax")}',{phone:phone,
                pwd:pwd,
                newpwd:newpwd,
            },function (data) {
                $.hideLoading();
                if(data['status']){
                    $.alert(data['result'], "提示",function () {

                    });

                }else{
                    $.alert(data['result'], "提示");
                }
            },'json')


        })









    })
</script>
</body>
</html>